package com.joinway.framework.admin.bean.view;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.ArrayUtils;

import com.joinway.framework.bean.view.View;

public class TableResultView extends View {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7580584354984433845L;

	/**
	 * 主键ID
	 */
	List<Integer> ids;

	public void setId(int id) {
		if(ids == null){
			ids = new ArrayList<>();
		}
		
		ids.add(id);
	}

	public List<Integer> getIds() {
		return ids;
	}

	public void setIds(List<Integer> ids) {
		this.ids = ids;
	}
	
	public void setIds(String[] strIds) {
		if(ArrayUtils.isNotEmpty(strIds)){
			if(ids == null){
				ids = new ArrayList<>();
			}
			
			for(String id : strIds){
				ids.add(Integer.valueOf(id));
			}
		}
	}
}
